//
//  TitleselectButton.m
//  hello
//
//  Created by 查传申 on 16/11/16.
//  Copyright © 2016年 查传申. All rights reserved.
//

#import "TitleselectButton.h"

@implementation TitleselectButton
-(id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.label_title = [[UILabel alloc]initWithFrame:CGRectZero];
        [self addSubview:_label_title];
        
        self.imageV = [[UIImageView alloc]initWithFrame:CGRectZero];
        [self addSubview:_imageV];
        
    }
    return self;
    
}
-(void)layoutSubviews{
    [super layoutSubviews];
    _label_title.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
    [_label_title sizeToFit];
    _label_title.center = CGPointMake(self.frame.size.width/2-15, self.frame.size.height/2 );
    _imageV.frame = CGRectMake(CGRectGetMaxX(_label_title.frame)+10, 0, 20, 20);
    _imageV.center = CGPointMake(_imageV.center.x, _label_title.center.y);
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
